#include<iostream>
#include<fstream>
#include<sstream>
#include<cstdlib>
#include<map>
#include<vector>
using namespace std;
class CHTML{
	map<string,map<string,string>> things;
	string randStr(){
		string ret;
		int a=8;
		while(a--){
			ret+=string(1,rand()%128);
		}
		return ret;
	}
	pair<string, string> cut(const string &str) {
	    pair<string, string> pss;
	    size_t eq_pos = str.find('=');
	    
	    if (eq_pos != string::npos) {
	        pss.first = str.substr(0, eq_pos);
	        pss.second = str.substr(eq_pos + 1);
	    } else {
	        pss.first = str;
	        pss.second = "";
	    }
	    
	    return pss;
	}
	public:
		void run(const string &_chtm){
			string cmd;string t1,t2,t3;bool inStr=0;
			vector<string> vs;
		    for(int post=0;post<_chtm.size();post++){
		        if(_chtm[post]==' '||_chtm[post]=='\n'){
		
		        }else if(_chtm[post]!='['){
		            cout<<_chtm[post];
		        }else{
		        	cmd="";inStr=0;vs.clear();t1="";
		        	while(_chtm[++post]!=']'){
		        		cmd+=string(1,_chtm[post]);
					}
					for(int poi=0;poi<cmd.size();poi++){
						if((cmd[poi]==' '||cmd[poi]=='\t'||cmd[poi]=='\n')&&!inStr){
							vs.push_back(t1);
							t1="";
						}
						if(cmd[poi]=='\"')inStr=!inStr;
						t1+=string(1,cmd[poi]);
					}
					map<string,string> mss;
					for(int pvs=1;pvs<vs.size();pvs++){
						mss.insert(cut(vs[pvs]));
					}
					if(mss.find("id")==mss.end()){
						
					}
				}
		    }
		}
};

int main(int ac,char **av){
    if(ac==1){
        cout<<R"(Welcome to use CHTML!
(c) langhat 2025
CHTML is a lang that is a mark lang.
)";
        return 0;
    }
    string temp,_chtm,t2;
    for(int i=1;i<ac;i++){
        temp=av[i];
        if(temp=="help"){
            cout<<R"(Welcome to use CHTML!
(c) langhat 2025
CHTML is a lang that is a mark lang.
)";
        }else if(temp=="run"){
            temp=av[++i];
            ifstream code(temp);
            while(getline(code,t2)){
                _chtm+=t2+"\n";
            }
            CHTML chtm;
            chtm.run(_chtm);
            _chtm="";
        }else if(temp=="run-arg"){
            _chtm=av[++i];
            CHTML chtm;
            chtm.run(_chtm);
            _chtm="";
        }
    }
}